import http from './request'
/**
 * 获取验证码
 * @param {*} url
 * @param {*} data
 * @returns
 */
export const getCode = (mobile) => {
  return http.get('/api/member/code', {
    params: {
      mobile,
    },
  })
}
/**
 * 首页列表
 * @returns 
 */
export const getList = (id) =>{
  return http.get('/api/homestays/list')
}
/**
 * 登录
 * @param {*} mobile
 * @param {*} code
 * @returns
 */
export const PostLogin = (data) => {
  return http.post('/api/member/login_v2', data)
}
/**
 * 获取会员信息
 * @returns
 */
export const getTokenUser = () => http.get('/api/member/info')
/**
 * 获取民宿信息
 * @returns
 */
export const getHomeMsg = () => http.get('/api/homestays/list')
/**
 * 发布房源
 * @returns
 */
export const Release = (url, data) => {
  return http.post(url, data)
}
/**
 * 签到
 * @returns
 */
export const SignIn = () => http.post('/api/sign/insert01')
/**
 * 上传头像
 * @param {*} data
 * @returns
 */
export const uploadFiles = (data) => http.post('/api/member/upload/avatar', data)
/**
 * 修改个人信息
 * @param {*} url
 * @param {*} data
 * @returns
 */
export const UseUpdate = (url, data) => {
  return http.post(url, data)
}
